<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateArticlesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('articles', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedInteger('user_id')->default(0)->comment('用户ID');
            $table->unsignedInteger('category_id')->default(0)->comment('分类ID');
            $table->string('title',200)->comment('文章标题');
            $table->unsignedInteger('type',0)->default(0)->comment('文章类型');
            $table->string('keywords',255)->default('')->comment('文章关键词');
            $table->string('sources',100)->default('')->comment('文章来源');
            $table->string('description',255)->default('')->comment('文章摘要');
            $table->string('thumb',100)->default('')->comment('文章封面');
            $table->text('content')->comment('文章内容');
            $table->integer('click')->default(0)->comment('点击量');
            $table->integer('like')->default(0)->comment('点赞');
            $table->integer('dislike')->default(0)->comment('点踩');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('articles');
    }
}
